#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;

	int ans[4][2] = { 0 };

	// one line
	if (n == 0 || m == 0)
	{
		if (n == 0)
		{
			ans[0][0] = 0;
			ans[0][1] = 1;
			ans[1][0] = 0;
			ans[1][1] = m;

			ans[2][0] = 0;
			ans[2][1] = 0;
			ans[3][0] = 0;
			ans[3][1] = m - 1;
		}
		else
		{
			ans[0][0] = 1;
			ans[0][1] = 0;
			ans[1][0] = n;
			ans[1][1] = 0;

			ans[2][0] = 0;
			ans[2][1] = 0;
			ans[3][0] = n - 1;
			ans[3][1] = 0;
		}
	}
	else
	{
		if (n > m)
		{
			double a = 2 * sqrt(m*m*1.0 + n*n) + n;
			double b = 2 * sqrt(n*n*1.0 + (m - 1)*(m - 1)) + sqrt(m*m*1.0 + n*n);

			if (a > b)
			{
				ans[0][0] = n;
				ans[0][1] = m;
				ans[1][0] = 0;
				ans[1][1] = 0;
				ans[2][0] = n;
				ans[2][1] = 0;
				ans[3][0] = 0;
				ans[3][1] = m;
			}
			else
			{
				ans[0][0] = n;
				ans[0][1] = m - 1;
				ans[1][0] = 0;
				ans[1][1] = 0;
				ans[2][0] = n;
				ans[2][1] = m;
				ans[3][0] = 0;
				ans[3][1] = 1;
			}
		}
		else
		{
			double a = 2 * sqrt(m*m*1.0 + n*n) + m;
			double b = 2 * sqrt(m*m*1.0 + (n - 1)*(n - 1)) + sqrt(m*m*1.0 + n*n);

			if (a > b)
			{
				ans[0][0] = n;
				ans[0][1] = m;
				ans[1][0] = 0;
				ans[1][1] = 0;
				ans[2][0] = 0;
				ans[2][1] = m;
				ans[3][0] = n;
				ans[3][1] = 0;
			}
			else
			{
				ans[0][0] = n - 1;
				ans[0][1] = m;
				ans[1][0] = 0;
				ans[1][1] = 0;
				ans[2][0] = n;
				ans[2][1] = m;
				ans[3][0] = 1;
				ans[3][1] = 0;
			}
		}
	}

	for (int i = 0; i < 4; ++i)
	{
		printf("%d %d\n", ans[i][0], ans[i][1]);
	}
 
	return 0;
}